<?
// set default page name to index
if (!isset($p))  $p="home";
// set default path to root dir of site
if (!isset($r))  $r="";

require_once($r."_config/db.php");
require_once($r."_engine/c_session.php");
require_once($r."_engine/mail_functions.php");
require_once($r."_inc/mailto_engine.php");


// 'a'	- path ancestor page
// 'l'	- link to page from root point
// 't'	- title of the page
// 'tp' - title for the path line
// 'ts'	- short title of the page (menu, navigator)
$g_site_struct = array();

$g_site_struct["home"] = array('l'=>"index.php",
	't'=>"Home");

// -------------------------------------------------------------------
// -------                    Newcomers                         ------
// -------------------------------------------------------------------
$a1 = "newcomers"; $d1 = "newcomers/";
$g_site_struct[$a1] = array(
	't'=>"Newcomres");

$g_site_struct["demo"] = array('a'=>$a1, 'l'=>$d1."demo.php",
	'ts'=>"Demo", 
	't'=>"Demonstration",
	'simple_page'=>true);

$g_site_struct["signup"] = array('a'=>$a1, 'l'=>$d1."signup.php",
	't'=>"Free Trial",
	'simple_page'=>true);
$g_site_struct["signup_ack"] = array('a'=>"signup", 'l'=>$d1."signup_ack.php",
	't'=>"Registered Successfully",
	'simple_page'=>true);

$g_site_struct["plans"] = array('a'=>$a1, 'l'=>$d1."plans.php",
	't'=>"Plans",
	'simple_page'=>true);

$g_site_struct["faq"] = array('a'=>$a1, 'l'=>$d1."faq.php",
	't'=>"FAQ",
	'simple_page'=>true);

$g_site_struct["features"] = array('a'=>$a1, 'l'=>$d1."features.php",
	't'=>"Features");

$g_site_struct["case_studies"] = array('a'=>$a1, 'l'=>$d1."case_studies.php",
	't'=>"Case studies",
	'simple_page'=>true);


// -------------------------------------------------------------------
// -------                     Members                          ------
// -------------------------------------------------------------------
$a1 = "members"; $d1 = "members/";
$g_site_struct["login"] = array('a'=>$a1, 'l'=>$d1."login.php",
	't'=>"Login",
	'simple_page'=>true);

$g_site_struct["cp"] = array('a'=>$a1, 'l'=>$d1."dashboard.php",
	't'=>"Dashboard");

$g_site_struct["cp_monitor_new"] = array('a'=>"cp", 'l'=>$d1."cp_monitor.php",
	't'=>"New Monitor");
$g_site_struct["cp_monitor_edit"] = array('a'=>"cp",
	't'=>"Edit Monitor");

$g_site_struct["cp_monitor_history"] = array('a'=>"cp",
	't'=>"Monitor History");

$g_site_struct["profile"] = array('a'=>"cp", 'l'=>$d1."profile.php",
	't'=>"Profile",
	'simple_page'=>true);
$g_site_struct["defaults"] = array('a'=>"cp", 'l'=>$d1."defaults.php",
	't'=>"Account Settings",
	'simple_page'=>true);
	
$g_site_struct["quick_actions_delete"] = array('a'=>"cp", 'l'=>$d1."quick_actions_delete.php",
	't'=>"Monitor Deleting",
	'simple_page'=>true);

	
$g_site_struct["monitoring_summary"] = array('a'=>$a1, 'l'=>$d1."monitoring_summary.php",
	't'=>"Monitoring Changes Summary");

$g_site_struct["news"] = array('a'=>$a1, 'l'=>$d1."news.php",
	't'=>"News",
	'simple_page'=>true);
$g_site_struct["news_detail"] = array('a'=>"news", 'l'=>$d1."news_detail.php",
	't'=>"News Detail",
	'simple_page'=>true);
$g_site_struct["news_archive"] = array('a'=>"news", 'l'=>$d1."news_archive.php",
	't'=>"News Archive",
	'simple_page'=>true);

$g_site_struct["support"] = array('a'=>$a1, 'l'=>$d1."support.php",
	't'=>"Support");
	
$g_site_struct["suggestions"] = array('a'=>$a1, 'l'=>$d1."suggestions.php",
	't'=>"Suggestions");

$g_site_struct["logout"] = array('a'=>$a1, 'l'=>$d1."logout.php",
	't'=>"Logout");

$g_site_struct["password_recovery"] = array('a'=>$a1, 'l'=>$d1."password_recovery.php",
	't'=>"Password Assistance",
	'simple_page'=>true);
$g_site_struct["password_recovery_ack"] = array('a'=>"password_recovery", 'l'=>$d1."password_recovery_ack.php",
	't'=>"Password Sent",
	'simple_page'=>true);

$g_site_struct["plans"] = array('a'=>$a1, 'l'=>$d1."plans.php",
	't'=>"Plans",
	'simple_page'=>true);

// -------------------------------------------------------------------
// -------                      Company                         ------
// -------------------------------------------------------------------
$a1 = "company"; $d1 = "company/";
$g_site_struct["about"] = array('a'=>$a1, 'l'=>$d1."about.php",
	't'=>"About W3Monitor",
	'simple_page'=>true);

$g_site_struct["press"] = array('a'=>$a1, 'l'=>$d1."press.php",
	't'=>"Press Releases",
	'simple_page'=>true);

$g_site_struct["links"] = array('a'=>$a1, 'l'=>$d1."links.php",
	't'=>"Links");

$g_site_struct["taf"] = array('a'=>$a1, 'l'=>$d1."taf.php",
	't'=>"Tell a Friend");
$g_site_struct["taf_ack"] = array('a'=>"taf", 'l'=>$d1."taf_ack.php",
	't'=>"Thank you for your submission",
	'tp'=>"Acknowledgment");

$g_site_struct["contact"] = array('a'=>$a1, 'l'=>$d1."contact.php",
	't'=>"Contact Us",
	'simple_page'=>true);

$g_site_struct["terms"] = array('a'=>$a1, 'l'=>$d1."terms.php",
	't'=>"Terms of Service",
	'simple_page'=>true);

$g_site_struct["privacy"] = array('a'=>$a1, 'l'=>$d1."privacy.php",
	't'=>"Privacy Policy",
	'simple_page'=>true);


// -------------------------------------------------------------------
// -------                        Misc                          ------
// -------------------------------------------------------------------
$a1 = "home"; $d1 = "";
$g_site_struct["sitemap"] = array('a'=>$a1, 'l'=>$d1."sitemap.php",
	't'=>"Site Map",
	'simple_page'=>true);

$g_site_struct["error_time"] = array('a'=>$a1, 'l'=>$d1."../admin/error_time.php",
	't'=>"Test Long Time Page Generation",
	'simple_page'=>true);

$g_site_struct["monitored_sites"] = array('a'=>$a1, 'l'=>$d1."monitored_sites.php",
	't'=>"Explore Monitored Sites",
	'simple_page'=>true);

$g_site_struct["quick_reg_ack"] = array('a'=>$a1, 'l'=>$d1."quick_reg_ack.php",
	't'=>"Quick registration / Quick add monitor");

$a1 = "subscribe"; $d1 = "";
$g_site_struct[$a1] = array(
	't'=>"W3Monitor Newsletter Subscription");
$g_site_struct["subscribe_ack"] = array('a'=>$a1, 'l'=>$d1."subscribe_ack.php",
	't'=>"W3Monitor Newsletter Subscription",
	'tp'=>"ACK");
$g_site_struct["subscribe_fail"] = array('a'=>$a1, 'l'=>$d1."subscribe_fail.php",
	't'=>"Newsletter Subscription Failed",
	'tp'=>"Subscription Failed");

$a2 = "unsubscribe"; $d2 = $d1."";
$g_site_struct[$a2] = array('a'=>$a1, 'l'=>"unsubscribe.php",
	't'=>"W3Monitor Newsletter UnSubscription",
	'tp'=>"Unsubscribe");
$g_site_struct["unsubscribe_ack"] = array('a'=>$a2, 'l'=>"unsubscribe_ack.php",
	't'=>"W3Monitor Newsletter UnSubscription",
	'tp'=>"ACK");
$g_site_struct["unsubscribe_fail"] = array('a'=>$a2, 'l'=>"unsubscribe_fail.php",
	't'=>"Newsletter UnSubscription Failed",
	'tp'=>"Failed");

$g_site_struct["price"] = array('l'=>"price/index.php",
	't'=>"Price File Update");

	

// set title of page
$titles = array ();
foreach ($g_site_struct as $k=>$v)
{
	$titles[$k] = @$v['t'];
}

if (!isset($title)) 
	$title = @$titles[$p];
if (!isset($title)) 
	$title = "";


function HrefToPage($p)
{
	global $r, $g_site_struct;
	return @$r.$g_site_struct[$p]['l'];
}

?>